package main

// @lc code=start

func main() {

	x := twoSum([]int{3, 2, 4}, 6)
	for _, v := range x {
		println(v)
	}
}

func twoSum(nums []int, target int) []int {

	hashTable := map[int]int{}
	for i, x := range nums {

		if j, ok := hashTable[target-x]; ok {
			return []int{j, i}
		}
		hashTable[x] = i
	}

	return []int{0, 0}

}

// @lc code=end
